/* ========================================================================
 * Copyright 2007 The Apache Software Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless reqired by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================================
 


 * Created on 1 oct. 2007
 * @author pollux
*/
package org.poxd.frisar.model;

import java.util.Iterator;
/**
 * This interface define the contract for the model of the frise.
 * 
 * @author pollux
 */
public interface FriseModel {
    
    /**
     * Add an element to the model
     *  
     * @param FriseElement element
     * @return id
     */
    public ElementId addElement(FriseElement element);

    /**
     * Retrieves a FriseElement from his ElementId.
     * 
     * @param id - the id of the FriseElement
     * @return the Frise Element corresponding
     */
    public FriseElement getElement(ElementId id);

    /**
     * Retrieves the iterator over the ElementId's
     * 
     * @return an iterator of ElementId
     */
    public Iterator<ElementId> keyIterator();

    /**
     * Mainly for internal purpose.
     * 
     * @param id - the id of the element to test if the next element should be a hole
     * @return boolean hole
     */
    public boolean isNextHole(ElementId el);

    /**
     * Removes a FriseElement from the model
     * 
     * @param id - the id of the corresponding FriseElement
     */
    public void remove(ElementId id);
}
